<template>
    <div>
        <Child
            :count="count"
            :name="name"
            :age="age"
            @addCount="addCount"
        />
    </div>
</template>

<script>
import { reactive, toRefs } from '@vue/composition-api';
import Child from './component';

export default {
    components: {
        Child,
    },
    setup () {
        const state = reactive({
            count: 0,
            name: 'zs',
            age: 18,
        });
        const addCount = () => {
            state.count += 1;
        };
        return {
            ...toRefs(state),
            addCount,
        };
    },
};
</script>

<style>

</style>
